__author__ = 'sdjkx'


from PyQt5.QtWidgets import QDialog, QGridLayout,QProgressBar
from PyQt5.QtCore import Qt

class ProgressBarDialog(QDialog):

    def __init__(self, parent=None, listItem=None):
        super(ProgressBarDialog, self).__init__(parent)

        self.setGeometry(400,400,400,100)
        self.setWindowTitle("压缩进度")
        self.setWindowModality(Qt.ApplicationModal)


        gridLayout = QGridLayout()
        self.pb11 = QProgressBar()
        self.pb11.setOrientation(Qt.Horizontal)
        gridLayout.addWidget(self.pb11,0,0,6,1)
        self.setLayout(gridLayout)

    def setRange(self, count):
        self.pb11.setRange(1,count)
        self.v = 1

    def addValue(self):
        self.v = self.v + 1
        self.pb11.setValue(self.v)
